﻿using System;
using System.Windows;
using System.Windows.Data;

namespace AutoClick
{
    public class CheckBoxVisibilityConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            try
            {
                Boolean isMouseOver = (Boolean)(values[0]);
                Boolean isSelected = (Boolean)(values[1]);
                if (isSelected)
                    return Visibility.Visible;
                else if (isMouseOver)
                    return Visibility.Visible;
                else
                    return Visibility.Hidden;
            }
            catch { return Visibility.Hidden; }
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            return null;
        }
    }
}
